package com.elai.baseconfig.service.impl;

import java.util.List;
import com.elai.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.elai.baseconfig.mapper.OperateEquityTypeMapper;
import com.elai.baseconfig.domain.OperateEquityTypeDO;
import com.elai.baseconfig.service.OperateEquityTypeService;

/**
 * 权益类型Service业务层处理
 *
 * @author elai
 * @date 2021-04-10
 */
@Service
public class OperateEquityTypeServiceImpl implements OperateEquityTypeService
{
    @Autowired
    private OperateEquityTypeMapper operateEquityTypeMapper;

    /**
     * 查询权益类型
     *
     * @param id 权益类型ID
     * @return 权益类型
     */
    @Override
    public OperateEquityTypeDO selectOperateEquityTypeById(Long id)
    {
        return operateEquityTypeMapper.selectOperateEquityTypeById(id);
    }

    /**
     * 查询权益类型列表
     *
     * @param operateEquityType 权益类型
     * @return 权益类型
     */
    @Override
    public List<OperateEquityTypeDO> selectOperateEquityTypeList(OperateEquityTypeDO operateEquityType)
    {
        return operateEquityTypeMapper.selectOperateEquityTypeList(operateEquityType);
    }

    /**
     * 新增权益类型
     *
     * @param operateEquityType 权益类型
     * @return 结果
     */
    @Override
    public int insertOperateEquityType(OperateEquityTypeDO operateEquityType)
    {
        operateEquityType.setCreateTime(DateUtils.getNowDate());
    operateEquityType.setUpdateTime(DateUtils.getNowDate());
        return operateEquityTypeMapper.insertOperateEquityType(operateEquityType);
    }

    /**
     * 修改权益类型
     *
     * @param operateEquityType 权益类型
     * @return 结果
     */
    @Override
    public int updateOperateEquityType(OperateEquityTypeDO operateEquityType)
    {
        operateEquityType.setUpdateTime(DateUtils.getNowDate());
        return operateEquityTypeMapper.updateOperateEquityType(operateEquityType);
    }

    /**
     * 批量删除权益类型
     *
     * @param ids 需要删除的权益类型ID
     * @return 结果
     */
    @Override
    public int deleteOperateEquityTypeByIds(Long[] ids)
    {
        return operateEquityTypeMapper.deleteOperateEquityTypeByIds(ids);
    }

    /**
     * 删除权益类型信息
     *
     * @param id 权益类型ID
     * @return 结果
     */
    @Override
    public int deleteOperateEquityTypeById(Long id)
    {
        return operateEquityTypeMapper.deleteOperateEquityTypeById(id);
    }
}
